#include "dominion.h"
#include "dominion_helpers.h"
#include <string.h>
#include <stdio.h>
#include <assert.h>
#include "rngs.h"
#include <math.h>
#include <stdlib.h>
#include <stdio.h>

#define DEBUG 0
#define NOISY_TEST 1

int checkgetCost(int cardNumber) {

  int r, card;
  r =  getCost(cardNumber);
  card = -1;
  switch( cardNumber )
  {
     case curse:
	card = 0;
	break;
     case estate:
	card = 2;
	break;
     case duchy:
	card = 5;
	break;
     case province:
	card = 8;
	break;
     case copper:
	card = 0;
	break;
     case silver:
	card = 3;
	break;
     case gold:
	card = 6;
	break;
     case adventurer:
        card = 6;
	break;
     case council_room:
        card = 5;
	break;
     case feast:
	card = 4;
	break;
     case gardens:
	card = 4;
	break;
     case mine:
	card = 5;
	break;
     case remodel:
	card = 4;
	break;
     case smithy:
	card = 4;
	break;
     case village:
	card = 3;
	break;
     case baron:
	card = 4;
	break;
     case great_hall:
	card = 3;
	break;
     case minion:
	card = 5;
	break;
     case steward:
	card = 3;
	break;
     case tribute:
	card = 5;
	break;
     case ambassador:
	card = 3;
	break;
     case cutpurse:
	card = 4;
	break;
     case embargo:
	card = 2;
	break;
     case outpost:
	card = 5;
	break;
     case salvager:
	card = 4;
	break;
     case sea_hag:
	card = 4;
	break;
     case treasure_map:
	card = 4;
	break;
  }
  assert (r == card);

  return 0;
}

int main () {

  int i, n, cardNumber;
  

  printf ("Testing getCost.\n");

  printf ("RANDOM TESTS.\n");

  SelectStream(2);
  PutSeed(3);
  
  for (n = 0; n < 2000; n++) {
    cardNumber = floor(Random() * 30);
    checkgetCost(cardNumber); 
  }



  printf ("SIMPLE FIXED TESTS.\n");
  for (cardNumber = 0; cardNumber < 30; cardNumber++) {
	  checkgetCost(cardNumber);
	}
  
  printf ("ALL TESTS OK\n");

  return 0;
}
